<?php

namespace app\proxy\controller;
use app\data\model\LiveAppList;
use app\data\model\LiveIntegralRecord;
use app\data\model\LiveProxyList;
use think\admin\Controller;

/**
 * 积分记录
 * Class IntegralRecordController
 * @package app\proxy\controller
 */
class IntegralRecordController extends Controller
{
    /**
     * 查询
     * @auth true  # 表示需要验证权限
     * @menu true  # 添加系统菜单节点
     * @login true # 强制登录才可访问
     */
    public function index()
    {
        $this->title = '积分记录';

        $this->apps = LiveAppList::mk()->field('app_id,app_name')->select()->toArray();
        $this->proxys = LiveProxyList::mk()->field('id,user_account,user_nickname')->select()->toArray();

        $this->type = $this->request->get('type', 'index');
        $query = LiveIntegralRecord::mQuery();

        $query->equal('app_id,uuid,integral_type,create_uuid');
        $query->dateBetween('create_time');
        $query->order('create_time desc')->page();
    }
}